package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2023-05-14
 * Time: 0:33
 */
interface IShape{
    public static void funcStatic(){
        System.out.println("这是static修饰的方法！");
    }
    void draw();
        /*public String name = "1";
    public static String name2 = "1";
    public static final String name3 = "1";
    String name4 = "1";*/

    //public abstract void draw();
/*    default public void func(){
        System.out.println("默认的");
    }*/
}

class Rect implements IShape {

    @Override
    public void draw() {
        System.out.println("矩形！");
    }
/*    @Override
    public void func() {
        System.out.println("重写func方法！");
    }*/
}
class Flower implements IShape{
    @Override
    public void draw() {
        System.out.println("花！");
    }
}
public class Test {
    public static void drawMap(IShape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        //IShape shape = new IShape();
        IShape shape = new Rect();//向上转型
        IShape shape2 = new Flower();//向上转型

        drawMap(shape);
        drawMap(shape2);

        IShape.funcStatic();
    }
}
